# data = [i for i in range(10000)]
# print(data)
# print(data.__sizeof__())
# for data in data:
#     print(data)

# data1 = (i for i in range(10000))
# print(data1)
# print(data1.__sizeof__())


# 函数
def gen():
    for i in range(2):
        yield i


f = gen()

while True:
    try:
        print(next(f))
    except StopIteration:
        break


# try:
#     print(next(f))
#     print(next(f))
# except StopIteration:
#     print("迭代结束")
